#include <amxmodx>
#include <items>
#include <engine>

new PLUGIN_NAME[] 	= "UM Item: No Recoil"
new PLUGIN_AUTHOR[] 	= "Cheap_Suit"
new PLUGIN_VERSION[] 	= "1.1"

new bool:g_WeaponTraining[33] 
public plugin_init() 
{
	register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)
	register_item("Weapon Training", "No recoil", 3000)
}

public client_connect(id) {
	g_WeaponTraining[id] = false
}

public Enable_Item(id) {
	g_WeaponTraining[id] = true
}

public Disable_Item(id) {
	g_WeaponTraining[id] = false
	
}

public server_frame()
{
	new Players[32], iNum
	get_players(Players, iNum, "a")
	
	for(new i = 0; i < iNum; i++)
	{
		new id = Players[i]
		if(!g_WeaponTraining[id]) {
			continue
		}
		
		if(get_user_button(id) & IN_ATTACK) {
			entity_set_vector (id, EV_VEC_punchangle, Float:{0.0, 0.0, 0.0})
		}
	}
}
